using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace kkmylove_in_code
{
    class AnalysisWebPage
    {
        public AnalysisWebPage(string url)
        {
            Http_web_request = (HttpWebRequest)HttpWebRequest.Create(url);
        }
        public bool send()
        {
            Http_web_request.Timeout = 20000;
            Http_web_response = (HttpWebResponse)Http_web_request.GetResponse();
            this.cookie = Http_web_response.Cookies.ToString();
            Stream st = Http_web_response.GetResponseStream();
            StreamReader sr = new StreamReader(st, Encoding.UTF8);
            this.htmltext = sr.ReadToEnd().ToString();

            this.Header = Http_web_response.Headers.ToString();
            this.Statues = Http_web_response.StatusCode.ToString();
            return true;
        }
        public string GetHtml()
        {
            return this.htmltext;
        }
        public string GetCookie()
        {
            return this.cookie;
        }
        public string GetHeader()
        {
            return this.Header;
        }
        public string GetStatues()
        {
            return Statues;
        }
        System.Net.HttpWebRequest Http_web_request;
        System.Net.HttpWebResponse Http_web_response;
        string cookie;
        string htmltext;
        string Header;
        string Statues;
    }
}
